package com.cccyy.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexUtil {
    private static final String regex_mobile = "/^(?:(?:\\+|00)86)?1(?:(?:3[\\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\\d])|(?:9[01256789]))\\d{8}$/\n";

    public static void main(String[] args) {
        boolean b = checkPhoneNumber("12345678900");
        System.out.printf("判断结果为：%s \n", b);
    }

    public static boolean checkPhoneNumber(String phoneNumber) {
        Pattern pattern = Pattern.compile(regex_mobile);
        Matcher matcher = pattern.matcher(phoneNumber);
        return matcher.matches();
    }

}
